Micron Document
๐ŸŽ–๏ธGitะฏั€ะฐ๐ŸŽ–๏ธ


Displaying Raw โ€ข View rendered โ€ข Download

scripts/verify-flatpak/README.md docs/2.8.0-feature-docs (1f66dbf8) Text, 4.20 KB

Tc9d1d9# Local Flatpak Verification

Replicates vid's Ta5d6ff`org.meshtastic.desktop` GHA flatpak build on your machine so you
can validate Ta5d6ff`flatpak-sources.json` end-to-end without round-tripping through his repo.

Tc9d1d9## What it tests that our CI doesn't

Our CI (Ta5d6ff`:desktopApp:packageUberJarForCurrentOS :captureFlatpakSources`) only proves the manifest can be *generated*.
Vid's CI is where the manifest actually gets *consumed* by Ta5d6ff`flatpak-builder`. This script
runs that step locally:

Tff7b721. Clones Ta5d6ff`vidplace7/org.meshtastic.desktop`.
Tff7b722. Overlays a patched manifest that:
Tff7b72- Swaps the Ta5d6ff`meshtastic/Meshtastic-Android.git` source for a Ta5d6ff`type: dir` pointing at
**your local checkout** (so you can test uncommitted changes).
Tff7b72- Uncomments Ta5d6ff`- flatpak-sources.json`.
Tff7b72- Drops Ta5d6ff`--share=network` from the build-args (true offline โ€” what Flathub requires).
Tff7b72- Adds Ta5d6ff`--offline` to the Gradle invocation (belt + suspenders).
Tff7b723. Runs Ta5d6ff`flatpak-builder` in a Docker container with the same Freedesktop 25.08 SDK
vid's GHA image uses.

If your Ta5d6ff`flatpak-sources.json` has the wrong URL, wrong sha256, or a missing entry,
the build fails with the same error vid would see. You can iterate in ~5โ€“15 min loops
instead of waiting on cross-repo CI.

Tc9d1d9## Prerequisites

Tff7b72- Docker (Docker Desktop on macOS works โ€” the container needs Ta5d6ff`--privileged` to use
bubblewrap; that's enabled by default).
Tff7b72- ~10 GB free disk for the SDK + Gradle cache.
Tff7b72- A populated Gradle cache (Ta5d6ff`./gradlew :desktopApp:packageUberJarForCurrentOS` must have
run; the script does this implicitly via Ta5d6ff`:captureFlatpakSources`).

Tc9d1d9## Usage

Ta5d6ff```Ta5d6ffbash
T8b949e# Full offline build โ€” Linux host required (~15โ€“30 min first time)
scripts/verify-flatpak/verify.sh

T8b949e# URLs + sha256 verification only; skips the Gradle build phase.
T8b949e# Works on macOS where nested bwrap fails under Docker Desktop's seccomp.
scripts/verify-flatpak/verify.sh --download-only

T8b949e# Reuse an already-generated flatpak-sources.json (don't re-run Gradle)
scripts/verify-flatpak/verify.sh --skip-regen

T8b949e# Tight iteration loop after a failed run: refresh overlay yaml + manifest
T8b949e# only, then re-run flatpak-builder. Skips Gradle regen, vid-repo fetch,
T8b949e# and Meshtastic-Android rsync. Use when you've just patched the YAML
T8b949e# overlay or regenerated flatpak-sources.json by hand.
scripts/verify-flatpak/verify.sh --rebuild-only

T8b949e# Cross-arch test via QEMU emulation (slower)
scripts/verify-flatpak/verify.sh --arch aarch64

T8b949e# Drop into the builder container shell to poke at things
scripts/verify-flatpak/verify.sh --shell
Ta5d6ff```

Tc9d1d9### macOS limitation

Ta5d6ff`flatpak-builder` runs the build phase inside Ta5d6ff`bwrap` (bubblewrap). Nested
bwrap fails inside Docker Desktop on macOS with
Ta5d6ff`prctl(PR_SET_SECCOMP) EINVAL`. The script refuses to run a full build on
macOS by default โ€” pass Ta5d6ff`--download-only` to validate URLs + sha256s without
executing the Gradle build, or run the full script on a Linux host.

Tc9d1d9## Interpreting failures

| Symptom | Likely cause |
| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Ta5d6ff`Error downloading mirror: ... 404` on Ta5d6ff`repo.maven.apache.org` | URL captured by the listener was wrong or artifact moved. Check the source repo hosting it. |
| Ta5d6ff`sha256 mismatch` | Stale Ta5d6ff`flatpak-sources.json`; re-run Ta5d6ff`:desktopApp:packageUberJarForCurrentOS :captureFlatpakSources`. |
| Gradle: Ta5d6ff`Could not resolve all artifacts ... offline mode` | Missing dep in the manifest โ€” usually a compiler plugin or BOM that wasn't downloaded during capture. |

Tc9d1d9## Files

Tff7b72- Ta5d6ff`verify.sh` โ€” entry point. Idempotent: re-running just re-syncs the overlay and re-runs flatpak-builder.
Tff7b72- Ta5d6ff`desktop-offline.yaml` โ€” patched manifest. Kept in sync manually with vid's upstream;
diff against Ta5d6ff`https://raw.githubusercontent.com/vidplace7/org.meshtastic.desktop/main/org.meshtastic.desktop.yaml`
if vid changes something material.

Served by rngit 1.5.0 - Generated in 0.08s